﻿@model Test.Site.Data.Models.PagedListModel<Test.DataAccess.POCO.Role>
@using Test.Utility.Extensions
<!-- BEGIN SEARCH FORM PORTLET -->
<div class="portlet">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-reorder"></i>搜索
        </div>
    </div>
    <div class="portlet-body form">
        <!-- BEGIN FORM -->
        <form class="form-horizontal">
            <div class="form-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="control-label col-md-3" for="Keyword">
                                关键字：
                            </label>
                            <div class="col-md-9">
                                @Html.TextBoxFor(m => m.Keyword, new { @class = "form-control" })
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-actions">
                <div class="row">
                    <div class="col-md-offset-4 col-md-8">
                        <button type="submit" class="btn btn-success">搜索</button>
                        <button type="reset" class="btn btn-default">重置</button>
                    </div>
                </div>
            </div>
        </form>
        <!-- END FORM -->
    </div>
</div>
<!-- END SEARCH FORM PORTLET -->
<!-- BEGIN TABLE PORTLET -->
<div class="portlet box light-grey">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-reorder"></i>角色管理
        </div>
    </div>
    <div class="portlet-body">
        <div class="table-toolbar">
            <div class="btn-group">
                <a href="@Url.Action("CreateOrEditRole")" class="btn btn-success">
                    添加 <i class="fa fa-plus"></i>
                </a>
            </div>
        </div>
        <div class="dataTables_wrapper form-inline">
            <div class="table-scrollable">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>
                                角色名
                            </th>
                            <th>
                                角色描述
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.PagedList)
                        {
                            <tr>
                                <td>
                                    @item.RoleName
                                </td>
                                <td>
                                    @item.Description.SubstringWithDots()
                                </td>
                                <td>
                                    <a href="@Url.Action("CreateOrEditRole","Account",new { id = item.Id })" class="btn btn-info btn-xs"><i class="fa fa-edit"></i>编辑</a>
                                    <a data-confirm-text="确定要删除吗？" data-confirm-button="确定" data-cancel-button="取消"
                                       data-confirmed-url="@Url.Action("DeleteRole", "Account", new { id = item.Id })"
                                       class="btn btn-danger btn-xs js-table-ajax-confirm-button">
                                        <i class="fa fa-trash-o"></i>删除
                                    </a>
                                </td>
                            </tr>

                        }
                    </tbody>
                </table>
            </div>
            @Html.Partial("_Pagination", Model.PagedList, Model.QueryParameter)
        </div>
    </div>
</div>
<!-- BEGIN TABLE PORTLET -->
